package com.woniu.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 任务表
 * @TableName task
 */
@TableName(value ="task")
@Data
public class Task implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @ExcelIgnore
    private Long id;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 任务编号
     */
    private String taskNumber;

    /**
     * 报警消息表id
     */
    private Long alarmMessageId;

    /**
     * 工作周期
     */
    private String workCycle;

    /**
     * 任务类型
     */
    private String taskType;

    /**
     * 计划开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date plannedStartTime;

    /**
     * 计划结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date plannedEndTime;

    /**
     * 实际开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date actualStartTime;

    /**
     * 实际结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date actualEndTime;

    /**
     * 运维人员id
     */
    private Long maintenancePersonId;

    /**
     * 任务状态（待定）
     */
    private String taskStatus;

    /**
     * 任务说明
     */
    private String taskDescription;

    /**
     * 处理说明
     */
    private String handlingDescription;

    /**
     * 现场处理图片
     */
    private Object onSiteImages;

    /*
    * 充电站id
    * */
    private Long stationId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Task other = (Task) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTaskName() == null ? other.getTaskName() == null : this.getTaskName().equals(other.getTaskName()))
            && (this.getTaskNumber() == null ? other.getTaskNumber() == null : this.getTaskNumber().equals(other.getTaskNumber()))
            && (this.getAlarmMessageId() == null ? other.getAlarmMessageId() == null : this.getAlarmMessageId().equals(other.getAlarmMessageId()))
            && (this.getWorkCycle() == null ? other.getWorkCycle() == null : this.getWorkCycle().equals(other.getWorkCycle()))
            && (this.getTaskType() == null ? other.getTaskType() == null : this.getTaskType().equals(other.getTaskType()))
            && (this.getPlannedStartTime() == null ? other.getPlannedStartTime() == null : this.getPlannedStartTime().equals(other.getPlannedStartTime()))
            && (this.getPlannedEndTime() == null ? other.getPlannedEndTime() == null : this.getPlannedEndTime().equals(other.getPlannedEndTime()))
            && (this.getActualStartTime() == null ? other.getActualStartTime() == null : this.getActualStartTime().equals(other.getActualStartTime()))
            && (this.getActualEndTime() == null ? other.getActualEndTime() == null : this.getActualEndTime().equals(other.getActualEndTime()))
            && (this.getMaintenancePersonId() == null ? other.getMaintenancePersonId() == null : this.getMaintenancePersonId().equals(other.getMaintenancePersonId()))
            && (this.getTaskStatus() == null ? other.getTaskStatus() == null : this.getTaskStatus().equals(other.getTaskStatus()))
            && (this.getTaskDescription() == null ? other.getTaskDescription() == null : this.getTaskDescription().equals(other.getTaskDescription()))
            && (this.getHandlingDescription() == null ? other.getHandlingDescription() == null : this.getHandlingDescription().equals(other.getHandlingDescription()))
            && (this.getOnSiteImages() == null ? other.getOnSiteImages() == null : this.getOnSiteImages().equals(other.getOnSiteImages()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTaskName() == null) ? 0 : getTaskName().hashCode());
        result = prime * result + ((getTaskNumber() == null) ? 0 : getTaskNumber().hashCode());
        result = prime * result + ((getAlarmMessageId() == null) ? 0 : getAlarmMessageId().hashCode());
        result = prime * result + ((getWorkCycle() == null) ? 0 : getWorkCycle().hashCode());
        result = prime * result + ((getTaskType() == null) ? 0 : getTaskType().hashCode());
        result = prime * result + ((getPlannedStartTime() == null) ? 0 : getPlannedStartTime().hashCode());
        result = prime * result + ((getPlannedEndTime() == null) ? 0 : getPlannedEndTime().hashCode());
        result = prime * result + ((getActualStartTime() == null) ? 0 : getActualStartTime().hashCode());
        result = prime * result + ((getActualEndTime() == null) ? 0 : getActualEndTime().hashCode());
        result = prime * result + ((getMaintenancePersonId() == null) ? 0 : getMaintenancePersonId().hashCode());
        result = prime * result + ((getTaskStatus() == null) ? 0 : getTaskStatus().hashCode());
        result = prime * result + ((getTaskDescription() == null) ? 0 : getTaskDescription().hashCode());
        result = prime * result + ((getHandlingDescription() == null) ? 0 : getHandlingDescription().hashCode());
        result = prime * result + ((getOnSiteImages() == null) ? 0 : getOnSiteImages().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", taskName=").append(taskName);
        sb.append(", taskNumber=").append(taskNumber);
        sb.append(", alarmMessageId=").append(alarmMessageId);
        sb.append(", workCycle=").append(workCycle);
        sb.append(", taskType=").append(taskType);
        sb.append(", plannedStartTime=").append(plannedStartTime);
        sb.append(", plannedEndTime=").append(plannedEndTime);
        sb.append(", actualStartTime=").append(actualStartTime);
        sb.append(", actualEndTime=").append(actualEndTime);
        sb.append(", maintenancePersonId=").append(maintenancePersonId);
        sb.append(", taskStatus=").append(taskStatus);
        sb.append(", taskDescription=").append(taskDescription);
        sb.append(", handlingDescription=").append(handlingDescription);
        sb.append(", onSiteImages=").append(onSiteImages);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}